package model

import "jsjb/connect"

type AuthGroup struct {
	ID    int32  `json:"id"`
	Pid   int32  `json:"pid"`
	Name  string `json:"name"`
	Pname string `json:"pname"`
	Rules string `json:"rules"`
}

func FindAuthGroup(groupId int32) (a *AuthGroup, err error) {
	a = new(AuthGroup)
	result := connect.DB.Table("auth_group").Where("id = ?", groupId).Find(&a)
	if result.Error != nil {
		err = result.Error
	}
	return
}
func SelectAuthGroup(groupIds []int32) (os []AuthGroup, err error) {
	result := connect.DB.Where("id IN (?)", groupIds).Find(&os)
	if result.Error != nil {
		err = result.Error
	}
	return
}
